﻿<UserControl x:Class="Ivvy_Silverlight.MainPage" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:igSchedule="http://schemas.infragistics.com/xaml"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"    
    xmlns:igSchedulePrim="http://schemas.infragistics.com/xaml/primitives"
    xmlns:igPrim="http://schemas.infragistics.com/xaml/primitives"
    xmlns:igLayout="http://schemas.infragistics.com/xaml"
    xmlns:sys="clr-namespace:System;assembly=mscorlib"    
    xmlns:custom="clr-namespace:Ivvy_Silverlight.Ivvy;assembly=Ivvy_Silverlight"
    mc:Ignorable="d"
    d:DesignHeight="608" d:DesignWidth="1012" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" Loaded="UserControl_Loaded">
   

    <Canvas x:Name="LayoutRoot" Background="White" Height="535" Width="1149">
        <Canvas.Resources>
            <igPrim:ValueConverterGroup x:Key="tsOrientationToThicknessConverter">
                <!-- When arranged vertically have a 1 pixel border on bottom -->
                <igPrim:FixedValueConverter>
                    <igPrim:FixedValueConverter.SourceValue>
                        <Orientation>Vertical</Orientation>
                    </igPrim:FixedValueConverter.SourceValue>
                    <igPrim:FixedValueConverter.DestinationValue>
                        <Thickness>0,0,0,1</Thickness>
                    </igPrim:FixedValueConverter.DestinationValue>
                </igPrim:FixedValueConverter>

                <!-- When arranged horizontally have a 1 pixel border on right -->
                <igPrim:FixedValueConverter>
                    <igPrim:FixedValueConverter.DestinationValue>
                        <Thickness>0,0,1,0</Thickness>
                    </igPrim:FixedValueConverter.DestinationValue>
                </igPrim:FixedValueConverter>
            </igPrim:ValueConverterGroup>

            <igPrim:ValueConverterGroup x:Key="allDayVisToRowSpan">
                <igPrim:FixedValueConverter>
                    <igPrim:FixedValueConverter.SourceValue>
                        <Visibility>Collapsed</Visibility>
                    </igPrim:FixedValueConverter.SourceValue>
                    <igPrim:FixedValueConverter.DestinationValue>
                        <sys:Int32>2</sys:Int32>
                    </igPrim:FixedValueConverter.DestinationValue>
                </igPrim:FixedValueConverter>
                <igPrim:FixedValueConverter>
                    <igPrim:FixedValueConverter.DestinationValue>
                        <sys:Int32>1</sys:Int32>
                    </igPrim:FixedValueConverter.DestinationValue>
                </igPrim:FixedValueConverter>
            </igPrim:ValueConverterGroup>
            <igPrim:ValueConverterGroup x:Key="allDayVisToRow">
                <igPrim:FixedValueConverter>
                    <igPrim:FixedValueConverter.SourceValue>
                        <Visibility>Collapsed</Visibility>
                    </igPrim:FixedValueConverter.SourceValue>
                    <igPrim:FixedValueConverter.DestinationValue>
                        <sys:Int32>1</sys:Int32>
                    </igPrim:FixedValueConverter.DestinationValue>
                </igPrim:FixedValueConverter>
                <igPrim:FixedValueConverter>
                    <igPrim:FixedValueConverter.DestinationValue>
                        <sys:Int32>2</sys:Int32>
                    </igPrim:FixedValueConverter.DestinationValue>
                </igPrim:FixedValueConverter>
            </igPrim:ValueConverterGroup>
            <igPrim:ValueConverterGroup x:Key="notBoolToVisibility">
                <!-- if true sets visibility to Collapsed -->
                <igPrim:FixedValueConverter>
                    <igPrim:FixedValueConverter.SourceValue>
                        <sys:Boolean>True</sys:Boolean>
                    </igPrim:FixedValueConverter.SourceValue>
                    <igPrim:FixedValueConverter.DestinationValue>
                        <Visibility>Collapsed</Visibility>
                    </igPrim:FixedValueConverter.DestinationValue>
                </igPrim:FixedValueConverter>

                <!-- if false sets visibility to Visible -->
                <igPrim:FixedValueConverter>
                    <igPrim:FixedValueConverter.DestinationValue>
                        <Visibility>Visible</Visibility>
                    </igPrim:FixedValueConverter.DestinationValue>
                </igPrim:FixedValueConverter>
            </igPrim:ValueConverterGroup>
            <igPrim:ValueConverterGroup x:Key="notBoolToTextWrapping">
                <!-- if true sets TextWrapping to NoWrap -->
                <igPrim:FixedValueConverter>
                    <igPrim:FixedValueConverter.SourceValue>
                        <sys:Boolean>True</sys:Boolean>
                    </igPrim:FixedValueConverter.SourceValue>
                    <igPrim:FixedValueConverter.DestinationValue>
                        <TextWrapping>NoWrap</TextWrapping>
                    </igPrim:FixedValueConverter.DestinationValue>
                </igPrim:FixedValueConverter>

                <!-- if false sets TextWrapping to Wrap -->
                <igPrim:FixedValueConverter>
                    <igPrim:FixedValueConverter.DestinationValue>
                        <TextWrapping>Wrap</TextWrapping>
                    </igPrim:FixedValueConverter.DestinationValue>
                </igPrim:FixedValueConverter>
            </igPrim:ValueConverterGroup>
            <igPrim:ValueConverterGroup x:Key="dateRangeFormatToVisibility">
                <!-- if 'None' sets visibility to Collapsed -->
                <igPrim:FixedValueConverter>
                    <igPrim:FixedValueConverter.SourceValue>
                        <igSchedulePrim:DateRangeFormatType>None</igSchedulePrim:DateRangeFormatType>
                    </igPrim:FixedValueConverter.SourceValue>
                    <igPrim:FixedValueConverter.DestinationValue>
                        <Visibility>Collapsed</Visibility>
                    </igPrim:FixedValueConverter.DestinationValue>
                </igPrim:FixedValueConverter>
            </igPrim:ValueConverterGroup>
            <igPrim:ValueConverterGroup x:Key="boolToVisibility">
                <!-- if true sets visibility to Visible -->
                <igPrim:FixedValueConverter>
                    <igPrim:FixedValueConverter.SourceValue>
                        <sys:Boolean>True</sys:Boolean>
                    </igPrim:FixedValueConverter.SourceValue>
                    <igPrim:FixedValueConverter.DestinationValue>
                        <Visibility>Visible</Visibility>
                    </igPrim:FixedValueConverter.DestinationValue>
                </igPrim:FixedValueConverter>

                <!-- if false sets visibility to Collapsed -->
                <igPrim:FixedValueConverter>
                    <igPrim:FixedValueConverter.DestinationValue>
                        <Visibility>Collapsed</Visibility>
                    </igPrim:FixedValueConverter.DestinationValue>
                </igPrim:FixedValueConverter>
            </igPrim:ValueConverterGroup>
            <igPrim:ValueConverterGroup x:Key="boolToOccurrenceStyle">
                <!-- if true sets style to a variance indicator -->
                <igPrim:FixedValueConverter>
                    <igPrim:FixedValueConverter.SourceValue>
                        <sys:Boolean>True</sys:Boolean>
                    </igPrim:FixedValueConverter.SourceValue>
                    <igPrim:FixedValueConverter.DestinationValue>
                        <Style TargetType="ContentControl">
                            <Setter Property="Template">
                                <Setter.Value>
                                    <ControlTemplate TargetType="ContentControl">
                                        <Grid
											 Width="9"
											 Height="9">
                                            <Path
												Width="6"
												Height="5"
												HorizontalAlignment="Left"
												Margin="0,4,0,0"
												VerticalAlignment="Top"
												Data="M 0,5 C0,5 0,6 0,6 0,6 1,6 1,6 1,6 1,8 1,8 1,8 2,8 2,8 2,8 2,9 2,9 2,9 5,9 5,9 5,9 5,8 5,8 5,8 6,8 6,8 6,8 6,7 6,7 6,7 5,7 5,7 5,7 5,8 5,8 5,8 2,8 2,8 2,8 2,6 2,6 2,6 3,6 3,6 3,6 3,5 3,5 3,5 2,5 2,5 2,5 2,4 2,4 2,4 1,4 1,4 1,4 1,5 1,5 1,5 0,5 0,5 z"
												Fill="#404040"
												Stretch="Fill"/>
                                            <Path
												Width="6"
												Height="5"
												HorizontalAlignment="Left"
												Margin="3,1,0,0"
												VerticalAlignment="Top"
												Data="M 9,5 C9,5 9,4 9,4 9,4 8,4 8,4 8,4 8,2 8,2 8,2 7,2 7,2 7,2 7,1 7,1 7,1 4,1 4,1 4,1 4,2 4,2 4,2 3,2 3,2 3,2 3,3 3,3 3,3 4,3 4,3 4,3 4,2 4,2 4,2 7,2 7,2 7,2 7,4 7,4 7,4 6,4 6,4 6,4 6,5 6,5 6,5 7,5 7,5 7,5 7,6 7,6 7,6 8,6 8,6 8,6 8,5 8,5 8,5 9,5 9,5 z"
												Fill="#404040"
												Stretch="Fill"/>
                                            <Path
												Width="9"
												Height="9"
												HorizontalAlignment="Left"
												Margin="0,0,0,0"
												VerticalAlignment="Top"
												Data="M 8,0 C8,0 9,0 9,0 9,0 9,1 9,1 9,1 8,1 8,1 8,1 8,0 8,0 zM 7,1 C7,1 8,1 8,1 8,1 8,2 8,2 8,2 7,2 7,2 7,2 7,1 7,1 zM 6,2 C6,2 7,2 7,2 7,2 7,3 7,3 7,3 6,3 6,3 6,3 6,2 6,2 zM 5,3 C5,3 6,3 6,3 6,3 6,4 6,4 6,4 5,4 5,4 5,4 5,3 5,3 zM 4,4 C4,4 5,4 5,4 5,4 5,5 5,5 5,5 4,5 4,5 4,5 4,4 4,4 zM 3,5 C3,5 4,5 4,5 4,5 4,6 4,6 4,6 3,6 3,6 3,6 3,5 3,5 zM 2,6 C2,6 3,6 3,6 3,6 3,7 3,7 3,7 2,7 2,7 2,7 2,6 2,6 zM 1,7 C1,7 2,7 2,7 2,7 2,8 2,8 2,8 1,8 1,8 1,8 1,7 1,7 zM 0,8 C0,8 1,8 1,8 1,8 1,9 1,9 1,9 0,9 0,9 0,9 0,8 0,8 z"
												Fill="#404040"
												Stretch="Fill"/>
                                        </Grid>
                                    </ControlTemplate>
                                </Setter.Value>
                            </Setter>
                        </Style>
                    </igPrim:FixedValueConverter.DestinationValue>
                </igPrim:FixedValueConverter>

                <!-- if false sets style to the occureance indicator -->
                <igPrim:FixedValueConverter>
                    <igPrim:FixedValueConverter.DestinationValue>
                        <Style TargetType="ContentControl">
                            <Setter Property="Template">
                                <Setter.Value>
                                    <ControlTemplate TargetType="ContentControl">
                                        <Grid
											 Width="9"
											 Height="8"
											 x:Name="reccurence">
                                            <Path
												Width="6"
												Height="5"
												HorizontalAlignment="Left"
												Margin="0,3,0,0"
												VerticalAlignment="Top"
												Data="M 0,4 C0,4 0,5 0,5 0,5 1,5 1,5 1,5 1,7 1,7 1,7 2,7 2,7 2,7 2,8 2,8 2,8 5,8 5,8 5,8 5,7 5,7 5,7 6,7 6,7 6,7 6,6 6,6 6,6 5,6 5,6 5,6 5,7 5,7 5,7 2,7 2,7 2,7 2,5 2,5 2,5 3,5 3,5 3,5 3,4 3,4 3,4 2,4 2,4 2,4 2,3 2,3 2,3 1,3 1,3 1,3 1,4 1,4 1,4 0,4 0,4 z"
												Fill="#404040"
												Stretch="Fill"/>
                                            <Path
												Width="6"
												Height="5"
												HorizontalAlignment="Left"
												Margin="3,0,0,0"
												VerticalAlignment="Top"
												Data="M 9,4 C9,4 9,3 9,3 9,3 8,3 8,3 8,3 8,1 8,1 8,1 7,1 7,1 7,1 7,0 7,0 7,0 4,0 4,0 4,0 4,1 4,1 4,1 3,1 3,1 3,1 3,2 3,2 3,2 4,2 4,2 4,2 4,1 4,1 4,1 7,1 7,1 7,1 7,3 7,3 7,3 6,3 6,3 6,3 6,4 6,4 6,4 7,4 7,4 7,4 7,5 7,5 7,5 8,5 8,5 8,5 8,4 8,4 8,4 9,4 9,4 z"
												Fill="#404040"
												Stretch="Fill"/>
                                        </Grid>
                                    </ControlTemplate>
                                </Setter.Value>
                            </Setter>
                        </Style>
                    </igPrim:FixedValueConverter.DestinationValue>
                </igPrim:FixedValueConverter>
            </igPrim:ValueConverterGroup>
            <igPrim:ValueConverterGroup x:Key="boolToHorizontal">
                <!-- if true sets orientation to Horizontal -->
                <igPrim:FixedValueConverter>
                    <igPrim:FixedValueConverter.SourceValue>
                        <sys:Boolean>True</sys:Boolean>
                    </igPrim:FixedValueConverter.SourceValue>
                    <igPrim:FixedValueConverter.DestinationValue>
                        <Orientation>Horizontal</Orientation>
                    </igPrim:FixedValueConverter.DestinationValue>
                </igPrim:FixedValueConverter>

                <!-- if false sets orientation to Vertical -->
                <igPrim:FixedValueConverter>
                    <igPrim:FixedValueConverter.DestinationValue>
                        <Orientation>Vertical</Orientation>
                    </igPrim:FixedValueConverter.DestinationValue>
                </igPrim:FixedValueConverter>
            </igPrim:ValueConverterGroup>
            <igPrim:ValueConverterGroup x:Key="nullToVisibility">
                <!-- if null sets visibility to Collapsed -->
                <igPrim:FixedValueConverter SourceValue="{x:Null}">
                    <igPrim:FixedValueConverter.DestinationValue>
                        <Visibility>Collapsed</Visibility>
                    </igPrim:FixedValueConverter.DestinationValue>
                </igPrim:FixedValueConverter>

                <!-- if not null sets visibility to Visible -->
                <igPrim:FixedValueConverter>
                    <igPrim:FixedValueConverter.DestinationValue>
                        <Visibility>Visible</Visibility>
                    </igPrim:FixedValueConverter.DestinationValue>
                </igPrim:FixedValueConverter>

            </igPrim:ValueConverterGroup>
            <igPrim:ValueConverterGroup x:Key="notConverter">
                <igPrim:FixedValueConverter>
                    <igPrim:FixedValueConverter.SourceValue>
                        <sys:Boolean>True</sys:Boolean>
                    </igPrim:FixedValueConverter.SourceValue>
                    <igPrim:FixedValueConverter.DestinationValue>
                        <sys:Boolean>False</sys:Boolean>
                    </igPrim:FixedValueConverter.DestinationValue>
                </igPrim:FixedValueConverter>
                <igPrim:FixedValueConverter>
                    <igPrim:FixedValueConverter.DestinationValue>
                        <sys:Boolean>True</sys:Boolean>
                    </igPrim:FixedValueConverter.DestinationValue>
                </igPrim:FixedValueConverter>
            </igPrim:ValueConverterGroup>
            <DataTemplate x:Key="activityToolTipTemplate">
                <StackPanel Orientation="Vertical" Margin="5,0,3,0">
                    <StackPanel Orientation="Horizontal">
                        <igSchedulePrim:ScheduleDateRangePresenter
						ConvertDateTimeToLocal="{Binding Path=Activity.IsTimeZoneNeutral, Converter={StaticResource notConverter}}"
						FontSize="{Binding Path=ActivityPresenter.FontSize}"
						Start="{Binding Path=Activity.Start}"
						End="{Binding Path=Activity.End}"
									/>
                        <TextBlock Text="{Binding Path=Activity.Subject}"
									 Margin="5,0,0,0"
									FontSize="{Binding Path=ActivityPresenter.FontSize}"
									/>
                    </StackPanel>

                    <TextBlock Text="{Binding Path=ActivityPresenter.AdditionalText}" 
								 Visibility="{Binding Path=ActivityPresenter.AdditionalText, Converter={StaticResource nullToVisibility}}"
									FontSize="{Binding Path=ActivityPresenter.FontSize}"
									Margin="0,1,0,1"/>

                    <!--Error info-->
                    <Grid Margin="0,3,3,3" Visibility="{Binding Error, Converter={StaticResource nullToVisibility}}">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="5"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <Rectangle Grid.ColumnSpan="3" VerticalAlignment="Center"  Height="1" Fill="{Binding Path=ActivityPresenter.(igSchedulePrim:CalendarBrushProvider.BrushProvider)[ToolTipForeground]}"/>
                        <Path
					Grid.Row="1"
					Grid.Column="0"
						Margin="2,3,2,2"
						Height="11"
						Width="11"
						Stretch="Fill"
						Data="M 3,7 C3,7 4,7 4,7 4,7 4,8 4,8 4,8 3,8 3,8 3,8 3,7 3,7 zM 4,6 C4,6 5,6 5,6 5,6 5,7 5,7 5,7 4,7 4,7 4,7 4,6 4,6 zM 7,3 C7,3 8,3 8,3 8,3 8,4 8,4 8,4 7,4 7,4 7,4 7,3 7,3 zM 6,4 C6,4 7,4 7,4 7,4 7,5 7,5 7,5 6,5 6,5 6,5 6,4 6,4 zM 7,7 C7,7 8,7 8,7 8,7 8,8 8,8 8,8 7,8 7,8 7,8 7,7 7,7 zM 6,6 C6,6 7,6 7,6 7,6 7,7 7,7 7,7 6,7 6,7 6,7 6,6 6,6 zM 5,5 C5,5 6,5 6,5 6,5 6,6 6,6 6,6 5,6 5,6 5,6 5,5 5,5 zM 4,4 C4,4 5,4 5,4 5,4 5,5 5,5 5,5 4,5 4,5 4,5 4,4 4,4 zM 3,3 C3,3 4,3 4,3 4,3 4,4 4,4 4,4 3,4 3,4 3,4 3,3 3,3 zM 1,2 C1,2 2,2 2,2 2,2 2,3 2,3 2,3 1,3 1,3 1,3 1,2 1,2 zM 2,1 C2,1 3,1 3,1 3,1 3,2 3,2 3,2 2,2 2,2 2,2 2,1 2,1 zM 3,0 C3,0 8,0 8,0 8,0 8,1 8,1 8,1 3,1 3,1 3,1 3,0 3,0 zM 8,1 C8,1 9,1 9,1 9,1 9,2 9,2 9,2 8,2 8,2 8,2 8,1 8,1 zM 9,2 C9,2 10,2 10,2 10,2 10,3 10,3 10,3 9,3 9,3 9,3 9,2 9,2 zM 10,3 C10,3 11,3 11,3 11,3 11,8 11,8 11,8 10,8 10,8 10,8 10,3 10,3 zM 9,8 C9,8 10,8 10,8 10,8 10,9 10,9 10,9 9,9 9,9 9,9 9,8 9,8 zM 8,9 C8,9 9,9 9,9 9,9 9,10 9,10 9,10 8,10 8,10 8,10 8,9 8,9 zM 3,10 C3,10 8,10 8,10 8,10 8,11 8,11 8,11 3,11 3,11 3,11 3,10 3,10 zM 2,9 C2,9 3,9 3,9 3,9 3,10 3,10 3,10 2,10 2,10 2,10 2,9 2,9 zM 1,8 C1,8 2,8 2,8 2,8 2,9 2,9 2,9 1,9 1,9 1,9 1,8 1,8 zM 0,3 C0,3 1,3 1,3 1,3 1,8 1,8 1,8 0,8 0,8 0,8 0,3 0,3 z"
						Fill="{Binding Path=ActivityPresenter.(igSchedulePrim:CalendarBrushProvider.BrushProvider)[ToolTipErrorForeground]}"
												/>

                        <ContentControl
					Grid.Row="1"
					Grid.Column="1"
					FontSize="{Binding Path=ActivityPresenter.FontSize}"
					Foreground="{Binding Path=ActivityPresenter.(igSchedulePrim:CalendarBrushProvider.BrushProvider)[ToolTipErrorForeground]}">
                            <igSchedulePrim:ScheduleResourceString ResourceName="ToolTipErrorLabel"/>
                        </ContentControl>

                        <TextBlock 
					Grid.Row="2"
					Grid.Column="1"
					Grid.ColumnSpan="2"
					Text="{Binding Path=Error.UserErrorText}"
									FontSize="{Binding Path=ActivityPresenter.FontSize}"
									 TextWrapping="Wrap"
									 MaxWidth="600"
									 Margin="0,0,1,0"/>
                    </Grid>
                </StackPanel>
            </DataTemplate>
            <Style x:Key="outOfViewIndicator" TargetType="ContentControl">
                <Setter Property="Width" Value="9"/>
                <Setter Property="Height" Value="9"/>
                <Setter Property="VerticalAlignment" Value="Top"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="ContentControl">
                            <Grid>
                                <Path
										 Width="7"
										 Height="5"
										 HorizontalAlignment="Left"
										 Margin="1,2,0,0"
										 VerticalAlignment="Top"
										 Data="M 3,2 C3,2 3,3 3,3 3,3 2,3 2,3 2,3 2,4 2,4 2,4 1,4 1,4 1,4 1,5 1,5 1,5 2,5 2,5 2,5 2,6 2,6 2,6 3,6 3,6 3,6 3,7 3,7 3,7 4,7 4,7 4,7 4,6 4,6 4,6 8,6 8,6 8,6 8,3 8,3 8,3 4,3 4,3 4,3 4,2 4,2 4,2 3,2 3,2 z"
										 Stretch="Fill">
                                    <Path.Fill>
                                        <LinearGradientBrush StartPoint="0.571,0.2" EndPoint="0.570,0.814">
                                            <LinearGradientBrush.GradientStops>
                                                <GradientStopCollection>
                                                    <GradientStop Offset="0" Color="#FF999999"/>
                                                    <GradientStop Offset="0.994" Color="#FF333333"/>
                                                </GradientStopCollection>
                                            </LinearGradientBrush.GradientStops>
                                        </LinearGradientBrush>
                                    </Path.Fill>
                                </Path>
                                <Path
										 Width="9"
										 Height="9"
										 HorizontalAlignment="Left"
										 VerticalAlignment="Top"
										 Data="M 2,6 C2,6 2,5 2,5 2,5 1,5 1,5 1,5 1,4 1,4 1,4 2,4 2,4 2,4 2,3 2,3 2,3 3,3 3,3 3,3 3,2 3,2 3,2 4,2 4,2 4,2 4,3 4,3 4,3 5,3 5,3 5,3 8,3 8,3 8,3 8,6 8,6 8,6 5,6 5,6 5,6 4,6 4,6 4,6 4,7 4,7 4,7 3,7 3,7 3,7 3,6 3,6 3,6 2,6 2,6 zM 1,5 C1,5 1,6 1,6 1,6 2,6 2,6 2,6 2,7 2,7 2,7 3,7 3,7 3,7 3,8 3,8 3,8 4,8 4,8 4,8 4,9 4,9 4,9 5,9 5,9 5,9 5,8 5,8 5,8 5,7 5,7 5,7 9,7 9,7 9,7 9,6 9,6 9,6 9,3 9,3 9,3 9,2 9,2 9,2 5,2 5,2 5,2 5,0 5,0 5,0 4,0 4,0 4,0 4,1 4,1 4,1 3,1 3,1 3,1 3,2 3,2 3,2 2,2 2,2 2,2 2,3 2,3 2,3 1,3 1,3 1,3 1,4 1,4 1,4 0,4 0,4 0,4 0,5 0,5 0,5 1,5 1,5 z"
										 Fill="#404040"
										 Stretch="Fill"/>
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <LinearGradientBrush x:Key="reminderBrush" StartPoint="0.5,0" EndPoint="0.5,1">
                <LinearGradientBrush.GradientStops>
                    <GradientStopCollection>
                        <GradientStop Offset="0" Color="#FF666666"/>
                        <GradientStop Offset="0.994" Color="#FF404040"/>
                    </GradientStopCollection>
                </LinearGradientBrush.GradientStops>
            </LinearGradientBrush>
            <Style x:Key="simpleTextBox" TargetType="TextBox">
                <Setter Property="Background" Value="Transparent" />
                <Setter Property="Margin" Value="0" />
                <Setter Property="Padding" Value="0" />
                <Setter Property="BorderThickness" Value="0" />
            </Style>

            <ControlTemplate x:Key="ActivityTemplate"  TargetType="igSchedulePrim:ActivityPresenter">
                <Grid>
                    <VisualStateManager.VisualStateGroups>
                        <VisualStateGroup Name="InteractionStates">
                            <VisualState Name="Display" />
                            <VisualState Name="Editing">
                                <Storyboard Storyboard.TargetName="EditPanel" Storyboard.TargetProperty="Orientation">
                                    <ObjectAnimationUsingKeyFrames>
                                        <DiscreteObjectKeyFrame KeyTime="0">
                                            <DiscreteObjectKeyFrame.Value>
                                                <Orientation>Vertical</Orientation>
                                            </DiscreteObjectKeyFrame.Value>
                                        </DiscreteObjectKeyFrame>
                                    </ObjectAnimationUsingKeyFrames>
                                </Storyboard>
                            </VisualState>
                        </VisualStateGroup>
                    </VisualStateManager.VisualStateGroups>

                    <Grid>
                        <ToolTipService.ToolTip>
                            <igSchedulePrim:ScheduleToolTip
							igSchedulePrim:CalendarBrushProvider.BrushProvider="{Binding Path=(igSchedulePrim:CalendarBrushProvider.BrushProvider), RelativeSource={RelativeSource TemplatedParent}}"
							Content="{Binding ToolTipInfo, RelativeSource={RelativeSource TemplatedParent}}"
							ContentTemplate="{StaticResource activityToolTipTemplate}"/>
                        </ToolTipService.ToolTip>

                        <Path
					Data="{TemplateBinding ComputedGeometry}"
					Fill="{Binding DataItem.FillColorEx}"
					Stroke ="{TemplateBinding ComputedBorderBrush}"
					StrokeThickness ="{TemplateBinding ComputedBorderStrokeThickness}"
					igPrim:XamlHelper.SnapsToDevicePixels="True"/>

                        <Border Padding="{TemplateBinding Padding}"
								Margin="{TemplateBinding ComputedContentMargin}"                                
								igPrim:XamlHelper.SnapsToDevicePixels="True">

                            <Grid Margin="2,0">

                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>

                                <!-- Start out of view indicator -->
                                <ContentControl Style="{StaticResource outOfViewIndicator}"
									Margin="0,3,3,2"
									Visibility="{TemplateBinding StartOutOfRangeIndicatorVisibility}"
											/>

                                <!-- Content -->
                                <igSchedulePrim:ActivityContentPanel x:Name="EditArea"
																								 VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
																								 ContentAreaAlignment="{TemplateBinding ComputedContentHorizontalAlignment}"
																								 InterAreaSpacing="4"
																								 Grid.Column="1">

                                    <!-- prefix area -->
                                    <igSchedulePrim:BestFitDateRangePresenter
								 igSchedulePrim:ActivityContentPanel.Area="Prefix"
								 HorizontalAlignment="Left"
								 Start="{TemplateBinding StartLocal}"
								 End="{TemplateBinding EndLocal}"
								 Foreground="{TemplateBinding ComputedDateTimeForeground}"
								 Visibility="{Binding Path=PrefixFormatType, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource dateRangeFormatToVisibility}}"
									VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
									FormatType="{TemplateBinding PrefixFormatType}"/>

                                    <!-- main area -->
                                    <StackPanel x:Name="EditPanel"
													Orientation="{Binding Path=IsSingleLineDisplay, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource boolToHorizontal}}"
													HorizontalAlignment="Left">
                                        <TextBlock Text="{Binding Subject}"
									Foreground="{TemplateBinding ComputedForeground}"
									TextWrapping="{Binding Path=IsSingleLineDisplay, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource notBoolToTextWrapping}}"
									Visibility="{Binding Path=IsInEditMode, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource notBoolToVisibility}}"
									FontWeight="Bold" />
                                        <TextBox Style="{StaticResource simpleTextBox}"
									x:Name="Editor"
									Text="{Binding Subject, Mode=TwoWay}"
									TextWrapping="{Binding Path=IsSingleLineDisplay, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource notBoolToTextWrapping}}"
									FontWeight="Bold"
									Foreground="{TemplateBinding ComputedForeground}"
									Visibility="{Binding Path=IsInEditMode, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource boolToVisibility}}"/>
                                        <TextBlock Text=";"
									Foreground="{TemplateBinding ComputedForeground}"
									FontWeight="Bold"
									Margin="0,0,3,0"
									Visibility="{TemplateBinding SeparatorVisibility}"/>
                                        <TextBlock Text="{Binding AdditionalText, RelativeSource={RelativeSource TemplatedParent}}"
									Foreground="{TemplateBinding ComputedForeground}"
									Visibility="{TemplateBinding AdditionalTextVisibility}"/>
                                    </StackPanel>

                                    <!-- indicator panel -->
                                    <StackPanel
								 igSchedulePrim:ActivityContentPanel.Area="Indicators"
								 Visibility="{TemplateBinding IndicatorAreaVisibility}"
								Orientation="Horizontal">

                                        <!-- Occurrence indicator -->
                                        <ContentControl Style="{Binding Path=IsVariance, Converter={StaticResource boolToOccurrenceStyle}}"
											Margin="2,3,2,2"
									Visibility="{Binding Path=IsOccurrence, Converter={StaticResource boolToVisibility}}"
												/>

                                        <!-- Reminder indicator -->
                                        <Path Width="10"
											Height="10"
											Stretch="Fill"
											Margin="2,3,2,2"
											Data="M 4,2 C4,2 6,2 6,2 6,2 6,3 6,3 6,3 7,3 7,3 7,3 7,7 7,7 7,7 8,7 8,7 8,7 8,8 8,8 8,8 2,8 2,8 2,8 2,7 2,7 2,7 3,7 3,7 3,7 3,3 3,3 3,3 4,3 4,3 4,3 4,2 4,2 zM 4,1 C4,1 4,2 4,2 4,2 3,2 3,2 3,2 3,3 3,3 3,3 2,3 2,3 2,3 2,7 2,7 2,7 1,7 1,7 1,7 1,8 1,8 1,8 1,9 1,9 1,9 4,9 4,9 4,9 4,10 4,10 4,10 6,10 6,10 6,10 6,9 6,9 6,9 8,9 8,9 8,9 9,9 9,9 9,9 9,8 9,8 9,8 9,7 9,7 9,7 8,7 8,7 8,7 8,3 8,3 8,3 7,3 7,3 7,3 7,2 7,2 7,2 6,2 6,2 6,2 6,1 6,1 6,1 4,1 4,1 zM 9,3 C9,3 9,4 9,4 9,4 10,4 10,4 10,4 10,3 10,3 10,3 9,3 9,3 zM 8,0 C8,0 8,1 8,1 8,1 9,1 9,1 9,1 9,0 9,0 9,0 8,0 8,0 zM 0,3 C0,3 0,4 0,4 0,4 1,4 1,4 1,4 1,3 1,3 1,3 0,3 0,3 zM 1,0 C1,0 1,1 1,1 1,1 2,1 2,1 2,1 2,0 2,0 2,0 1,0 1,0 z"
											Fill="{StaticResource reminderBrush}"
											Visibility="{Binding Path=ReminderVisibility, RelativeSource={RelativeSource TemplatedParent}}"
											/>

                                        <!-- Pending operation -->
                                        <igSchedulePrim:PendingOperationIndicator
									Margin="2,3,2,2"
									IsActive="{TemplateBinding HasPendingOperation}"
									Visibility="{Binding Path=HasPendingOperation, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource boolToVisibility}}"
												/>

                                        <!-- Error Icon -->
                                        <Path
										Margin="2,3,2,2"
										Height="11"
										Width="11"
										Stretch="Fill"
										Data="M 3,7 C3,7 4,7 4,7 4,7 4,8 4,8 4,8 3,8 3,8 3,8 3,7 3,7 zM 4,6 C4,6 5,6 5,6 5,6 5,7 5,7 5,7 4,7 4,7 4,7 4,6 4,6 zM 7,3 C7,3 8,3 8,3 8,3 8,4 8,4 8,4 7,4 7,4 7,4 7,3 7,3 zM 6,4 C6,4 7,4 7,4 7,4 7,5 7,5 7,5 6,5 6,5 6,5 6,4 6,4 zM 7,7 C7,7 8,7 8,7 8,7 8,8 8,8 8,8 7,8 7,8 7,8 7,7 7,7 zM 6,6 C6,6 7,6 7,6 7,6 7,7 7,7 7,7 6,7 6,7 6,7 6,6 6,6 zM 5,5 C5,5 6,5 6,5 6,5 6,6 6,6 6,6 5,6 5,6 5,6 5,5 5,5 zM 4,4 C4,4 5,4 5,4 5,4 5,5 5,5 5,5 4,5 4,5 4,5 4,4 4,4 zM 3,3 C3,3 4,3 4,3 4,3 4,4 4,4 4,4 3,4 3,4 3,4 3,3 3,3 zM 1,2 C1,2 2,2 2,2 2,2 2,3 2,3 2,3 1,3 1,3 1,3 1,2 1,2 zM 2,1 C2,1 3,1 3,1 3,1 3,2 3,2 3,2 2,2 2,2 2,2 2,1 2,1 zM 3,0 C3,0 8,0 8,0 8,0 8,1 8,1 8,1 3,1 3,1 3,1 3,0 3,0 zM 8,1 C8,1 9,1 9,1 9,1 9,2 9,2 9,2 8,2 8,2 8,2 8,1 8,1 zM 9,2 C9,2 10,2 10,2 10,2 10,3 10,3 10,3 9,3 9,3 9,3 9,2 9,2 zM 10,3 C10,3 11,3 11,3 11,3 11,8 11,8 11,8 10,8 10,8 10,8 10,3 10,3 zM 9,8 C9,8 10,8 10,8 10,8 10,9 10,9 10,9 9,9 9,9 9,9 9,8 9,8 zM 8,9 C8,9 9,9 9,9 9,9 9,10 9,10 9,10 8,10 8,10 8,10 8,9 8,9 zM 3,10 C3,10 8,10 8,10 8,10 8,11 8,11 8,11 3,11 3,11 3,11 3,10 3,10 zM 2,9 C2,9 3,9 3,9 3,9 3,10 3,10 3,10 2,10 2,10 2,10 2,9 2,9 zM 1,8 C1,8 2,8 2,8 2,8 2,9 2,9 2,9 1,9 1,9 1,9 1,8 1,8 zM 0,3 C0,3 1,3 1,3 1,3 1,8 1,8 1,8 0,8 0,8 0,8 0,3 0,3 z"
										Fill="#000000"
										Visibility="{Binding Path=ToolTipInfo.Error, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource nullToVisibility}}"
													/>

                                    </StackPanel>

                                    <!-- suffix area -->
                                    <igSchedulePrim:BestFitDateRangePresenter
								 igSchedulePrim:ActivityContentPanel.Area="Suffix"
								 HorizontalAlignment="Right"
								 Foreground="{TemplateBinding ComputedDateTimeForeground}"
								 Start="{TemplateBinding StartLocal}"
								 End="{TemplateBinding EndLocal}"
									Visibility="{Binding Path=SuffixFormatType, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource dateRangeFormatToVisibility}}"
									VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
									FormatType="{TemplateBinding SuffixFormatType}"/>
                                </igSchedulePrim:ActivityContentPanel>

                                <!-- End out of view indicator -->
                                <ContentControl Style="{StaticResource outOfViewIndicator}"
									Grid.Column="2"
									Margin="3,3,0,2"
									Visibility="{TemplateBinding EndOutOfRangeIndicatorVisibility}"
												>
                                    <ContentControl.RenderTransform>
                                        <RotateTransform CenterX="4.5" CenterY="4.5" Angle="180"/>
                                    </ContentControl.RenderTransform>
                                </ContentControl>


                            </Grid>
                        </Border>
                    </Grid>

                    <igSchedulePrim:ActivityResizerBar x:Name="LeadingResizer" IsLeading="True"/>
                    <igSchedulePrim:ActivityResizerBar x:Name="TrailingResizer" />
                </Grid>
            </ControlTemplate>
            <Style TargetType="igSchedulePrim:AppointmentPresenter">
                <Setter Property="VerticalContentAlignment" Value="Top" />
                <Setter Property="Template" Value="{StaticResource ActivityTemplate}"/>
            </Style>

            <Style x:Key="BlockingErrorStyle" TargetType="ContentControl">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="ContentControl">
                            <Grid >
                                <Grid.RowDefinitions>
                                    <RowDefinition Height ="Auto"/>
                                    <RowDefinition Height ="Auto"/>
                                    <RowDefinition Height ="*"/>
                                </Grid.RowDefinitions>

                                <Rectangle Grid.RowSpan="3"
											 Opacity=".9"
											 Fill="{Binding Path=(igSchedulePrim:CalendarBrushProvider.BrushProvider)[BlockingErrorBackground], RelativeSource={RelativeSource TemplatedParent}}"/>

                                <!--Header-->
                                <ContentControl
							Grid.Row="0"
							FontWeight="Bold"
							Foreground="{Binding Path=(igSchedulePrim:CalendarBrushProvider.BrushProvider)[BlockingErrorHeaderForeground], RelativeSource={RelativeSource TemplatedParent}}"
							Margin="5">
                                    <ContentControl.FontSize>
                                        <Binding Path="FontSize" RelativeSource="{RelativeSource TemplatedParent}">
                                            <Binding.Converter>
                                                <igPrim:MinMaxConverter MinValue="14"/>
                                            </Binding.Converter>
                                        </Binding>
                                    </ContentControl.FontSize>
                                    <igSchedulePrim:ScheduleResourceString ResourceName="BlockingErrorLiteral"/>
                                </ContentControl>

                                <!--Description-->
                                <TextBlock
							Grid.Row="1"
							Margin="5,0,5,0"
							FontWeight="Bold"
							TextWrapping="Wrap"
							Foreground="{Binding Path=(igSchedulePrim:CalendarBrushProvider.BrushProvider)[BlockingErrorForeground], RelativeSource={RelativeSource TemplatedParent}}"
							Text="{Binding Path=Content.UserErrorText, RelativeSource={RelativeSource TemplatedParent}}"
							Visibility="{Binding Path=Content.UserErrorText, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource nullToVisibility}}"
							>
							<TextBlock.FontSize>
								<Binding Path="FontSize" RelativeSource="{RelativeSource TemplatedParent}">
									<Binding.Converter>
										<igPrim:MinMaxConverter MinValue="12.5"/>
									</Binding.Converter>
								</Binding>
							</TextBlock.FontSize>

                                </TextBlock>

                                <!--Details-->
                                <ScrollViewer Grid.Row="2"
													Margin="5"
													HorizontalScrollBarVisibility="Auto"
													VerticalScrollBarVisibility="Auto">

                                    <TextBox 
								Text="{Binding Path=Content, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"
								Foreground="{Binding Path=(igSchedulePrim:CalendarBrushProvider.BrushProvider)[BlockingErrorForeground], RelativeSource={RelativeSource TemplatedParent}}"
								IsReadOnly="True"
								TextWrapping="Wrap"
								Background="{x:Null}"/>

                                </ScrollViewer>

                            </Grid>

                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

            <Style TargetType="igSchedule:XamDayView">
                <Setter Property="FontFamily" Value ="Segoe UI"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="igSchedule:XamDayView">
                            <Border BorderBrush="{TemplateBinding BorderBrush}"
							BorderThickness="{TemplateBinding BorderThickness}"
							Background="{TemplateBinding Background}"
							Padding="{TemplateBinding Padding}"
							igPrim:XamlHelper.SnapsToDevicePixels="True">

                                <VisualStateManager.VisualStateGroups>
                                    <VisualStateGroup Name="ErrorStates">
                                        <VisualState Name="NoError"/>
                                        <VisualState Name="Error">
                                            <Storyboard Storyboard.TargetName="ErrorDisplay" Storyboard.TargetProperty="Visibility">
                                                <ObjectAnimationUsingKeyFrames>
                                                    <DiscreteObjectKeyFrame KeyTime="0">
                                                        <DiscreteObjectKeyFrame.Value>
                                                            <Visibility>Visible</Visibility>
                                                        </DiscreteObjectKeyFrame.Value>
                                                    </DiscreteObjectKeyFrame>
                                                </ObjectAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </VisualState>
                                    </VisualStateGroup>
                                </VisualStateManager.VisualStateGroups>

                                <Grid x:Name="RootPanel" >
                                    <igLayout:GridBagPanel igPrim:XamlHelper.SnapsToDevicePixels="{TemplateBinding igPrim:XamlHelper.SnapsToDevicePixels}">
                                        <!-- Additional Timezone Headers -->
                                        <TextBlock Text="{TemplateBinding SecondaryTimeZoneLabel}"
									VerticalAlignment="Bottom"
                                    igLayout:GridBagPanel.Row="1"
                                    igLayout:GridBagPanel.Column="0"
                                    Margin="0,0,0,1"
                                    Visibility="{TemplateBinding SecondaryTimeZoneVisibility}" />
                                        <Rectangle igPrim:XamlHelper.SnapsToDevicePixels="True"
                                    Height="1"
                                    Fill="{Binding Path=DefaultBrushProvider[TimeslotHeaderTickmarkDayView], RelativeSource={RelativeSource TemplatedParent}}"
                                    VerticalAlignment="Bottom"
                                    igLayout:GridBagPanel.Row="1"
                                    igLayout:GridBagPanel.Column="0"
                                    igLayout:GridBagPanel.PreferredHeight="1"
                                    Visibility="{TemplateBinding SecondaryTimeZoneVisibility}" />
                                        <igSchedulePrim:DayViewTimeslotHeaderArea
                                    x:Name="SecondaryTimeZone"
									Background="{Binding Path=DefaultBrushProvider[TimeslotHeaderAreaBackgroundDayView], RelativeSource={RelativeSource TemplatedParent}}"
									BorderBrush="{Binding Path=DefaultBrushProvider[TimeslotHeaderAreaSeparator], RelativeSource={RelativeSource TemplatedParent}}"
									BorderThickness="0,0,1,0"
									igLayout:GridBagPanel.Row="2"
									igLayout:GridBagPanel.Column="0"
									Visibility="{TemplateBinding SecondaryTimeZoneVisibility}"
									igLayout:GridBagPanel.RowWeight="1" />

                                        <!-- Primary Timezone Headers -->
                                        <TextBlock Text="{TemplateBinding PrimaryTimeZoneLabel}"
									VerticalAlignment="Bottom"
                                    Margin="0,0,0,1"
                                    igLayout:GridBagPanel.Row="1"
                                    igLayout:GridBagPanel.Column="1" />
                                        <Rectangle igPrim:XamlHelper.SnapsToDevicePixels="True"
                                    Height="1"
                                    Fill="{Binding Path=DefaultBrushProvider[TimeslotHeaderTickmarkDayView], RelativeSource={RelativeSource TemplatedParent}}"
                                    VerticalAlignment="Bottom"
                                    igLayout:GridBagPanel.Row="1"
                                    igLayout:GridBagPanel.Column="1"
                                    igLayout:GridBagPanel.PreferredHeight="1" />
                                        <igSchedulePrim:DayViewTimeslotHeaderArea
                                    x:Name="PrimaryTimeZone" 
									Background="{Binding Path=DefaultBrushProvider[TimeslotHeaderAreaBackgroundDayView], RelativeSource={RelativeSource TemplatedParent}}"
									igLayout:GridBagPanel.Row="2" 
									igLayout:GridBagPanel.Column="1" 
									igLayout:GridBagPanel.RowWeight="1" />

                                        <igSchedulePrim:ScheduleStackPanel 
                                    x:Name="GroupHeadersPanel" 
									igLayout:GridBagPanel.Row="0" 
									igLayout:GridBagPanel.Column="2" 
									igLayout:GridBagPanel.ColumnWeight="1"
									Visibility="{TemplateBinding CalendarHeaderAreaVisibilityResolved}"
									/>

                                        <igSchedulePrim:ScheduleStackPanel
                                    x:Name="DayHeadersPanel" 
									igLayout:GridBagPanel.Row="1" 
									igLayout:GridBagPanel.Column="2" 
									igLayout:GridBagPanel.ColumnWeight="1" />

                                        <igSchedulePrim:ScheduleStackPanel
									x:Name="GroupsPanel" 
									igLayout:GridBagPanel.Row="2" 
									igLayout:GridBagPanel.Column="2" 
									igLayout:GridBagPanel.ColumnWeight="1"
									igLayout:GridBagPanel.RowWeight="1" 
                                            />

                                        <ScrollBar 
									igLayout:GridBagPanel.Column="3" 
									igLayout:GridBagPanel.Row="1" 
									Orientation="Vertical" 
									Style="{TemplateBinding ScrollBarStyle}"
									x:Name="DayHeadersScrollBar" />
                                        <ScrollBar 
									igLayout:GridBagPanel.Column="3" 
									igLayout:GridBagPanel.Row="{Binding MultiDayActivityAreaVisibility, Converter={StaticResource allDayVisToRow}, RelativeSource={RelativeSource TemplatedParent}}" 
									igLayout:GridBagPanel.RowSpan="{Binding MultiDayActivityAreaVisibility, Converter={StaticResource allDayVisToRowSpan}, RelativeSource={RelativeSource TemplatedParent}}" 
									Orientation="Vertical" 
									Style="{TemplateBinding ScrollBarStyle}"
									x:Name="TimeslotScrollBar" 
									igLayout:GridBagPanel.RowWeight="1" />
                                        <ScrollBar 
									igLayout:GridBagPanel.Column="2" 
									igLayout:GridBagPanel.Row="3" 
									igLayout:GridBagPanel.ColumnWeight="1"
									Orientation="Horizontal"
									Style="{TemplateBinding ScrollBarStyle}"
									x:Name="TimeslotGroupScrollBar" />
                                    </igLayout:GridBagPanel>

                                    <ContentControl x:Name="ErrorDisplay" 
															Visibility="Collapsed" 
															Content="{Binding Path=BlockingError, RelativeSource={RelativeSource TemplatedParent}}"
															Style="{StaticResource BlockingErrorStyle}"
															igSchedulePrim:CalendarBrushProvider.BrushProvider="{Binding Path=DefaultBrushProvider, RelativeSource={RelativeSource TemplatedParent}}"
															/>
                                </Grid>
                            </Border>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

            <Style TargetType="igSchedulePrim:CalendarGroupTimeslotArea">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="igSchedulePrim:CalendarGroupTimeslotArea">
                            <Border Margin ="{TemplateBinding ComputedMargin}"
							BorderBrush="{TemplateBinding ComputedBorderBrush}"
							BorderThickness="{TemplateBinding ComputedBorderThickness}"
							Padding="{TemplateBinding Padding}"
							igPrim:XamlHelper.SnapsToDevicePixels="True">
                             <custom:ExtendedScheduleStackPanel
							x:Name="ItemsPanel" 
							InterItemSpacing="-1" 
							igPrim:XamlHelper.SnapsToDevicePixels="{TemplateBinding igPrim:XamlHelper.SnapsToDevicePixels}"/>
                            </Border>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

            <ControlTemplate x:Key="timeslotAreaTemplate" TargetType="igSchedulePrim:TimeslotArea">
                <Border BorderBrush="{TemplateBinding ComputedBorderBrush}"
				BorderThickness="{TemplateBinding ComputedBorderThickness}"
				Background="{TemplateBinding ComputedBackground}"
				Padding="{TemplateBinding Padding}"
				igPrim:XamlHelper.SnapsToDevicePixels="True">
                    <Grid igPrim:XamlHelper.SnapsToDevicePixels="{TemplateBinding igPrim:XamlHelper.SnapsToDevicePixels}">
                        <custom:ExtendedTimeslotPanel x:Name="TimeslotPanel"  />
                        <custom:ExtendedScheduleActivityPanel x:Name="ActivityPanel" />
                    </Grid>
                </Border>
            </ControlTemplate>

            <Style TargetType="igSchedulePrim:DayViewTimeslotArea">
                <Setter Property="Template" Value="{StaticResource timeslotAreaTemplate}" />
            </Style>

            <Style TargetType="igSchedulePrim:TimeslotPresenter">
                <Setter Property="igPrim:XamlHelper.Focusable" Value="True" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="igSchedulePrim:TimeslotPresenter">
                            <custom:ExtendedGrid>
                                <Border x:Name="Border"
							BorderBrush="{TemplateBinding ComputedBorderBrush}"
							BorderThickness="{Binding Path=Orientation, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource tsOrientationToThicknessConverter}}"
							Background="{TemplateBinding ComputedBackground}"
							Padding="{TemplateBinding Padding}"
							igPrim:XamlHelper.SnapsToDevicePixels="True">
                                </Border>
                                <Border x:Name="DayBorder"
							BorderBrush="{TemplateBinding DayBorderBrush}"
							BorderThickness="{TemplateBinding DayBorderThickness}"
							Visibility="{TemplateBinding DayBorderVisibility}"
							igPrim:XamlHelper.SnapsToDevicePixels="True" >
                                </Border>
                            </custom:ExtendedGrid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>


        </Canvas.Resources>

        <Button Content="Load data from OData" Height="23" x:Name="LoadDataButton" Width="203" Canvas.Left="14" Canvas.Top="0" Click="LoadDataButton_Click" />
        <Button Content="New calendar item" Height="23" x:Name="NewCalendarButton" Width="203" Canvas.Left="14" Canvas.Top="26" Click="NewCalendarButton_Click" Visibility="Collapsed" />
		<TextBlock Height="23" HorizontalAlignment="Left" x:Name="MessageTB" Text="Messages" Width="492" Canvas.Left="502" Canvas.Top="4" />
        <Button Canvas.Left="14" Canvas.Top="109" Content="Save to isolated storage in XML" Height="23" Name="SaveToIStorageinXMLB" Width="203" Click="SaveToIStorageB_Click" />
        <Button Canvas.Left="12" Canvas.Top="138" Content="Load from isolated storage in XML" Height="23" Name="LoadFromIsolatedStorageinXMLB" Width="205" Click="LoadFromIsolatedStorageB_Click" />
        <Button Canvas.Left="14" Canvas.Top="167" Content="Save to isolated storage in binary" Height="23" Name="SaveToIStorageinBinaryB" Width="203" Click="SaveToIStorageinBinaryB_Click" />
        <Button Canvas.Left="12" Canvas.Top="196" Content="Load from isolated storage in binary" Height="23" Name="LoadFromIsolatedStorageinBinaryB" Width="205" Click="LoadFromIsolatedStorageinBinaryB_Click" />
        <Button Canvas.Left="16" Canvas.Top="282" Content="Test Event Asynch" Height="23" Name="TestButton" Width="114" Click="TestButton_Click" Visibility="Visible" />
        <Button Canvas.Left="14" Canvas.Top="253" Content="Synchronize CalendarItems" Height="23" Name="SynchronizeCalendarItemsButton" Width="205" Click="SynchronizeCalendarItemsButton_Click" />
        
        <Button Canvas.Left="20" Canvas.Top="309" Content="Test_ISS" Height="23" Name="Test_ISS" Visibility="Visible" Width="75" Click="Test_ISS_Click" />
        <Button Canvas.Left="102" Canvas.Top="309" Content="Test_ISSLoad" Height="23" Name="Test_ISSLoad" Visibility="Visible" Width="93" Click="Test_ISS_Load_Click" />
        <Button Canvas.Left="16" Canvas.Top="338" Content="Test SaveCal" Height="23" Name="Test_SaveView_Actual" Visibility="Visible" Width="79" Click="SaveMonthView" />
        <Button Canvas.Left="102" Canvas.Top="338" Content="Test LoadCal" Height="23" Name="LoadCal" Visibility="Visible" Width="93"  Click="LoadMonthView"/>
        
        <Button Canvas.Left="137" Canvas.Top="282" Content="Clear iss Store" Height="23" Name="x_clearstore" Visibility="Visible" Width="93" Click="clearstore" />
        <Button Canvas.Left="223" Canvas.Top="0" Content="Switch to day view" Height="23" Name="MonthDayViewButton" Width="146" Click="MonthDayViewButton_Click" />
        <Button Canvas.Left="14" Canvas.Top="223" Content="Delete all files in isolated storage" Height="23" Name="DeleteIsolatedStorageFilesButton" Width="203" Click="DeleteIsolatedStorageFilesButton_Click" />
        <Button Canvas.Left="16" Canvas.Top="367" Content="Test 2" Height="23" Name="TestTestButton" Width="77" Click="TestTestButton_Click" />
        <Button Canvas.Left="102" Canvas.Top="367" Content="Export to word" Height="23" Name="ExportToWordButton" Width="93" Click="ExportToWordButton_Click" />
        <Button Canvas.Left="16" Canvas.Top="396" Content="Close" Height="23" Name="CloseApplicationButton" Width="93" Click="CloseApplicationButton_Click" />
        <Button Canvas.Left="21" Canvas.Top="426" Content="Test ISS save" Height="23" Name="TestISSSaveButton" Width="99" Click="TestISSButton_Click" />
        <Button Canvas.Left="126" Canvas.Top="426" Content="Test ISS load" Height="23" Name="TestISSLoadButton" Width="99" Click="TestISSLoadButton_Click" />
        <Button Canvas.Left="115" Canvas.Top="396" Content="Test recurrence" Height="23" Name="TestReccurenceButton" Width="110" Click="TestReccurenceButton_Click" />

        <Button Canvas.Left="375" Canvas.Top="4" Content="Search" Height="23" Name="SearchButton" Width="75" Click="SearchButton_Click"/>
        <Button Canvas.Left="450" Canvas.Top="4" Content="Field Admin" Height="23" Name="FieldAdmin" Width="75" Click="NotesAdmin_Click"/>
        <Button Canvas.Left="16" Canvas.Top="52" Content="Save to isolated storage via Siaqodb" Height="23" Name="SaveviaSiaqodbButton" Width="222" Click="SaveviaSiaqodbButton_Click" />
        <Button Canvas.Left="14" Canvas.Top="81" Content="Load from isolated storage via Siaqodb" Height="23" Name="LoadviaSiaqodbButton" Width="224" Click="LoadviaSiaqodbButton_Click" />
        <Button Canvas.Left="21" Canvas.Top="455" Content="Test web invoke" Height="23" Name="TestWebInvokeButton" Width="166" Click="TestWebInvokeButton_Click"/>
    </Canvas>
</UserControl>
